﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Saper
{
    public partial class Scores : Form
    {
        private void ReadScores(string filename)
        {
            int counter = 0;
            string line;
            System.IO.StreamReader file =
            new System.IO.StreamReader(@filename, System.Text.Encoding.Default,false);
            while((line = file.ReadLine()) != null)
            {
                line = line.Trim();
                string[] s = line.Split();
                for (int i = 0; i < 3; i++)
                {
                    s[i].Replace("_"," ");
                    table.Rows[counter].Cells[i].Value = s[i];
                    
                }
                counter++;
            }
            file.Close();
        }
        
        public Scores()
        {
            InitializeComponent();
        }

        private void Scores_Load(object sender, EventArgs e)
        {
            
            table.RowCount = 3;
            table.Rows[0].Cells[0].Value = "Новичок";
            table.Rows[1].Cells[0].Value = "Любитель";
            table.Rows[2].Cells[0].Value = "Профи";
            ReadScores("scores.txt");
            
        }

        private void table_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
